<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core" 
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xml:lang="en" lang="en">
	
	<h:head>
	<script src="js/jquery-1.4.2.min.js"></script>
	<script>
   $(document).ready(function(){
    document.getElementById("form:summary").value="";
    });
   </script>
   <style>
   li span{
    font-size:15px;
   }
   .tableStyle{
    width:765px;

   }
   .tableStyle td{
         text-align: center;
   }
   </style>
	</h:head>
	<body>
		<p>
		<h:form>
				<rich:dataTable value="#{messagebean.mesList}" var="mes" id="table"
					rows="15" width="550" styleClass="tableStyle">
					
					<rich:column width="200">
						<f:facet name="header" >
							<h:outputText value="主题" />
						</f:facet>
						<a href="javascript:void(0);" onclick="location.href='messageOne2.jsf?messageid='+#{mes.messageid};">
						<h:outputText value="#{mes.messagetitle}"/>
						</a>
					</rich:column>
					<rich:column width="200">
						<f:facet name="header">
							<h:outputText value="时间" />
						</f:facet>
						<h:outputText value="#{mes.messagetime}" style="width: 100px">
						<f:convertDateTime pattern="yyyy-MM-dd HH:MM:SS"/>
						</h:outputText>
					</rich:column>
					<rich:column width="100">
						<f:facet name="header">
							<h:outputText value="收件人" />
						</f:facet>
						<h:outputText value="#{mes.messagefrom}" style="width: 100px" />
					</rich:column>
					<rich:column width="50">
					
						<f:facet name="header">
							<h:outputText value="删除" />
						</f:facet>
						<a4j:commandLink render="table" action="#{messagebean.delMessage}" onclick="return confirm('确定要将消息彻底吗？');">
							<img height="20px" width="20px" src="images/icons/delfile.png" alt="彻底删除" />	
							<a4j:param name="messageid" value="#{mes.messageid}"
										assignTo="#{messagebean.messageid}" />
						</a4j:commandLink>
					</rich:column>
					</rich:dataTable>
                 </h:form>
		</p>
	</body>
</html>
